package com.hzmg.handler.factory;

import com.hzmg.handler.http.GetRequestHandler;
import com.hzmg.handler.http.PostRequestHandler;
import com.hzmg.handler.http.RequestDeal;

import java.util.HashMap;
import java.util.Map;

public class RequestDealFactory {

    private static final Map<String, RequestDeal> requestDelMap = new HashMap<>();

    static {
        requestDelMap.put("GET", new GetRequestHandler());
        requestDelMap.put("POST", new PostRequestHandler());
    }

    public static RequestDeal getDealViaRequestMethod(String method) {
        return requestDelMap.get(method);
    }

}
